#include "mem.h"
#include <malloc.h>
#include <windows.h>

void* mem_malloc_aligned (size_t size, size_t alignment)
{
#ifndef STDE_WITH_MINGW
    return _aligned_malloc (size, alignment);
#else
    return __mingw_aligned_malloc (size, alignment);
#endif
}

void mem_free_aligned (void* block)
{
#ifndef STDE_WITH_MINGW
    return _aligned_free (block);
#else
    return __mingw_aligned_free (block);
#endif
}

size_t get_total_system_memory()
{
    MEMORYSTATUSEX status;
    status.dwLength = sizeof(status);
    GlobalMemoryStatusEx(&status);
    return status.ullTotalPhys;
}

